import request from '@/tools/request'

export function orderStatisticIndexReport(params = {},loading = false,) {
    return request({
        url: '/order/statistic/indexReport.do',
        method: 'get',
        params,
        loading
    })
}

//获取分组品种分类
export function orderVarietyGetTypeVariety(params = {},loading = false,) {
    return request({
        url: '/order/variety/getTypeVariety.do',
        method: 'get',
        params,
        loading
    })
}

// 获取品种的开闭市时间
export function orderOrderGetTradeTime(params = {},loading = false,) {
    return request({
        url: '/order/order/getTradeTime.do',
        method: 'get',
        params,
        loading
    })
}

// 获取配资
// varietyId: this.curVariety.varietyId,
// modeId: id, //base1 high2
// payType: this.gold ? 0 : 1, //实盘1 模拟0

export function orderVarietyGetAssetsByVarietyMode(params = {},loading = false,) {
    return request({
        url: '/order/variety/getAssetsByVarietyMode.do',
        method: 'get',
        params,
        loading
    })
}

// 查询持仓中的订单
export function orderNewOrderFindNewOrderList(params = {},loading = false,) {
    return request({
        url: '/order/newOrder/findNewOrderList.do',
        method: 'get',
        params,
        loading
    })
}

// 查询挂单
export function orderPendingOrderFindPendingOrder(params = {},loading = false,) {
    return request({
        url: '/order/pendingOrder/findPendingOrder.do',
        method: 'get',
        params,
        loading
    })
}

//设置止盈止损

export function orderNewOrderFindNewOrderVarietyPrice(params = {},loading = false,) {
    return request({
        url: '/order/newOrder/findNewOrderVarietyPrice.do',
        method: 'get',
        params,
        loading
    })
}

// 平仓
export function orderNewOrderUnwindNewOrder(params = {},loading = false,) {
    return request({
        url: '/order/newOrder/unwindNewOrder.do',
        method: 'get',
        params,
        loading
    })
}

// 平多单
export function orderNewOrderNnwindAllNewOrder(params = {},loading = false,) {
    return request({
        url: '/order/newOrder/unwindAllNewOrder.do',
        method: 'get',
        params,
        loading
    })
}

// 追单
export function orderNewOrderAppendNewOrder(params = {},loading = false,) {
    return request({
        url: '/order/newOrder/appendNewOrder.do',
        method: 'post',
        params,
        loading
    })
}
// 撤挂单
export function orderPendingOrderCanclePendingOrder(params = {},loading = false,) {
    return request({
        url: '/order/pendingOrder/canclePendingOrder.do',
        method: 'post',
        params,
        loading
    })
}

// 平追

export function orderNewOrderUnwindAndReverseNewOrder(params = {},loading = false,) {
    return request({
        url: '/order/newOrder/unwindAndReverseNewOrder.do',
        method: 'post',
        params,
        loading
    })
}

// 提交设置止盈止损
export function orderNewOrderUpdateNewOrderStopPrice(params = {},loading = false,) {
    return request({
        url: '/order/newOrder/updateNewOrderStopPrice.do',
        method: 'post',
        params,
        loading
    })
}

// 下单
export function orderNewOrderSubmitNewOrder(params={}, loading = false) {
    console.log('api--> order', params)
    return request({
        url: '/order/newOrder/submitNewOrder.do',
        method: 'post',
        params,
        loading,
    })
}

export function orderPendingOrderCreatePendingOrder(params={}, loading = false) {
    return request({
        url: '/order/pendingOrder/createPendingOrder.do',
        method: 'post',
        params,
        loading,
    })
}
// 0/order/pendingOrder/createPendingOrder.do














